<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>修改密码--layui后台管理模板 2.0</title>
    <meta name="renderer" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="format-detection" content="telephone=no"/>
    <link href="/resource/css/index.css" rel="stylesheet" type="text/css"/>
    <link rel="stylesheet" href="/resource/common/layui/css/layui.css" media="all"/>
</head>

<style>
    .layui-inline {
        width: 334px;
    }

    .layui-input-inline {
        width: 233px !important;
    }
</style>
<body class="index">
<div class="layui-form" style="margin:auto;margin-top:10px">
    <div class="top">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">用户名<span style="color: red">*</span></label>
                <div class="layui-input-inline">
                    <input id="userName" name="userName" lay-verify="required" class="layui-input"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">密码<span style="color: red">*</span></label>
                <div class="layui-input-inline">
                    <input id="passWord" value="" type="password" name="plainPassword" lay-verify="required"
                           class="layui-input"/>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">真实姓名<span style="color: red">*</span></label>
                <div class="layui-input-inline">
                    <input id="realName" value="" type="text" name="realName" lay-verify="required"
                           class="layui-input"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">性别</label>
                <div class="layui-input-inline">
                    <select name="sex">
                        <option>男</option>
                        <option>女</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">手机号<span style="color: red">*</span></label>
                <div class="layui-input-inline">
                    <input id="iphone" name="iphone" class="layui-input" lay-verify="phone"/>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">电子邮件<span style="color: red">*</span></label>
                <div class="layui-input-inline">
                    <input id="email" name="email" class="layui-input" lay-verify="email"/>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">联系地址</label>
                <div class="layui-input-inline">
                    <input id="address" name="address" class="layui-input"/>
                </div>
            </div>
        </div>
        <div class="notice_bot">
            <div class="r_right but_p">
                <button class="but_save layui-btn" lay-submit="" lay-filter="Submit" style="padding: 0">保存
                </button>
                <button class="but_close" onclick="Cancel()">关闭</button>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="/resource/common/layui/layui.js"></script>
<script type="text/javascript">

    var Cancel;
    layui.use(['table', 'layer', 'laydate', 'form'], function () {
        var table = layui.table,
            $ = layui.$,
            layer = layui.layer,
            form = layui.form;
        Cancel = function () {
            parent.layer.close(parent.layer.getFrameIndex(window.name));
        }
        form.on('submit(Submit)', function (data) {
            $.ajax({
                url: '/user/user.do',
                type: 'post',
                data: data.field,
                dataType: 'json',
                async: false,
                success: function (result) {
                    if (!result.status) {
                        parent.layer.msg(result.msg, {time: 2000});
                        return false;
                    } else {
                        layer.msg("添加成功!", {time: 1000});
                        parent.layer.close(parent.layer.getFrameIndex(window.name));
                        parent.layui.table.reload('tableId', {});
                    }
                }

            });
        });
    });

</script>

</body>
</html>